package com.langChain4j.model.factory;

import com.base.frame.util.ApplicationContextUtil;
import com.langChain4j.model.factory.impl.QWen3AgentLoader;
import org.springframework.context.ApplicationContext;

/**
 * @author linjun
 * @date 2025/8/21 11:39
 * @description
 */
public class AgentLoaderHandler {

    private static final ApplicationContext applicationContext = ApplicationContextUtil.getApplicationContext();

    private AgentLoader agentLoader;

    public AgentLoaderHandler(String platform) {
        if (!applicationContext.containsBean(platform)) {
            this.agentLoader = applicationContext.getBean(QWen3AgentLoader.class);
        } else {
            this.agentLoader = applicationContext.getBean(platform, AgentLoader.class);
        }
    }

    public AgentLoader getAgentLoader() {
        return this.agentLoader;
    }
}
